// src/components/EnvSwitch.tsx
// @ts-ignore
import React from 'react';

const EnvSwitch: React.FC = () => {
    const switchEnv = (env: string) => {
        localStorage.setItem('env', env);  // 切换环境
        window.location.reload();  // 切换后刷新页面，应用新的环境设置
    };

    return (
        <div style={{ display: 'flex', gap: '10px' }}>
            <button onClick={() => switchEnv('prd')}>生产环境</button>
            <button onClick={() => switchEnv('gray')}>灰度环境</button>
        </div>
    );
};

export default EnvSwitch;
